// 版权归 瞄你个汪 所有。使用本代码应遵守相关法律法规和Apache 2.0开源许可要求。
package top.geeke.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import top.geeke.entity.base.EntityBase;
import top.geeke.eunm.SysStatusEnum;
import top.geeke.toolkit.supertable.annotation.SuperColumn;
import top.geeke.toolkit.supertable.annotation.SuperIndex;
import top.geeke.toolkit.supertable.annotation.SuperTable;

import java.io.Serializable;

/**
 * <p>
 * 系统开放接口身份表
 * </p>
 * @author 瞄你个汪
 * @since 2024-05-01 12:00:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_open_access")
@SuperTable(value = "系统开放接口身份表", isSystem = true, indexes = {
        @SuperIndex(indexName ="sys_index_{table}_A", indexFields ="accessKey"),
})
public class SysOpenAccess extends EntityBase implements Serializable {
    private static final long serialVersionUID = 1L;

    @SuperColumn(value = "身份标识")
    private String accessKey;

    @SuperColumn(value = "密钥")
    private String accessSecret;

    @SuperColumn(value = "绑定的应用")
    private Long bindAppId;

    @SuperColumn(value = "绑定的租户")
    private Long bindTenantId;

    @SuperColumn(value = "绑定的用户")
    private Long bindUserId;

    @SuperColumn(value = "状态")
    private SysStatusEnum status = SysStatusEnum.Enabled;

    @SuperColumn(value = "排序", defaultValue = "100")
    private Integer orderNo = 100;

    @SuperColumn(value = "备注", nullable = true, length = 128)
    private String remark;

    @JsonIgnore
    @JsonIgnoreProperties
    @TableField(exist = false)
    private SysTenant bindTenant;

    @JsonIgnore
    @JsonIgnoreProperties
    @TableField(exist = false)
    private SysUser bindUser;
}
